home *** CD-ROM | disk | FTP | other *** search
- /* dos2call.c - does dos 2.0 calls checking carry flag on return */
- #include "stdio.h"
- #include "cminor.h"
- #include "asmtools.h"
-
- unsigned dos_err ; /* record error code here */
- unsigned dos_flags ; /* and flags here */
-
- dos2call(fun_no,pin,pout) /* do a DOS function call */
- int fun_no ; /* function number */
- REGS *pin ; /* points to input reg. structure */
- REGS *pout ; /* points to output reg. structure */
- {
- /* set up function code in AH */
- ( (BYTE_REGS *) pin) ->ah = fun_no ;
- dos_flags = swint(DOS_CALL,pin,pout) ; /* do the DOS call */
- if( ( dos_flags&CF_FLAG) != 0 ) /* check for an error return */
- { dos_err = pout->ax ; /* yes - record error value */
- return( -1 ) ; /* and return error value */
- }
- else
- { dos_err = 0 ; /* no error - clear error code */
- return( 0 ) ; /* return normal value */
- }
- }
-
-